package design.abstractfactory;

import design.factory.*;

/**
 * User: heihaier@xfuweng.com
 * Date: 2015/7/10
 * Time: 11:34
 */
public class ShapeFactory extends AbstractFactory {

    @Override
    public Color getColor(String type) {
        return null;
    }

    @Override
    public Shape getShap(String type) {

        Shape shape = null;

        switch (type) {

            case "circle":
                shape = new Circle();
                break;
            case "rectangle":
                shape = new Rectangle();
                break;
            case "square":
                shape = new Square();
                break;
            default:
                break;
        }

        return shape;
    }
}
